using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using TimeTableManagement.Entities;

namespace TimeTableManagement.Mapping
{
	public class Tb_Profile_ConfigMap : EntityTypeConfiguration<Tb_Profile_Config>
	{
		public Tb_Profile_ConfigMap()
		{
			// Primary Key
			this.HasKey(t => t.id);

			// Properties
			this.Property(t => t.keywork)
				.IsRequired()
				.IsFixedLength()
				.HasMaxLength(10);
				
			this.Property(t => t.display)
				.IsRequired()
				.IsFixedLength()
				.HasMaxLength(255);
				
			this.Property(t => t.option)
				.IsFixedLength()
				.HasMaxLength(255);
				
			// Table & Column Mappings
			this.ToTable("Tb_Profile_Config");
			this.Property(t => t.id).HasColumnName("id");
			this.Property(t => t.keywork).HasColumnName("keywork");
			this.Property(t => t.display).HasColumnName("display");
			this.Property(t => t.option).HasColumnName("option");
		}
	}
}

